<?php
/*
 * 标题：阿里紫订单管理系统
 * 作者：忆天网络 QQ715457186
 * 官方网址：www.fjd100.com||www.yi66.nett
 */
class MainWidget extends Widget {
	public function render($data){
			
			$menu = array(
				'Index'   => array( array('name'=>'system_info','list'=>array('index'=>'basic_info','account'=>'account_setting')), ),
				'Item'   => array( array('name'=>'item','list'=>array('index'=>'item_list','edit'=>'add_item')), array('name'=>'category','list'=>array('category'=>'category_list')), ),
				'Order'   => array( 
					array('name'=>'order','list'=>array('index'=>'all_order','add'=>'add_order','import'=>'bulk_action')),
					array('name'=>'order_statistics','list'=>array('statistics'=>'order_statistics','channel'=>'channel_statistics','region'=>'region_statistics','time'=>'time_statistics',)),
				 ),
	
				'Setting'=> array( 
					array('name'=>'setting','list'=>array('index'=>'system_setting','database'=>'database_manage','shipping'=>'shipping_manage','user_logs'=>'action_log')),
					array('name'=>'recycle','list'=>array('item'=>'item_list','order'=>'order_list')),
				 ),
			);
			if(!in_array('user',$_SESSION['user']['auth'])) unset($menu['User']);
			if(!in_array('article',$_SESSION['user']['auth'])) unset($menu['Article']);
			if(!in_array('setting',$_SESSION['user']['auth'])) unset($menu['Setting']);
			if(!in_array('itemView',$_SESSION['user']['auth'])) unset($menu['Item']);
			if(!in_array('itemAdd',$_SESSION['user']['auth'])) unset($menu['Item'][0]['list']['edit']);
			if(!in_array('itemCategory',$_SESSION['user']['auth'])) unset($menu['Item'][1]);
			if(!in_array('orderView',$_SESSION['user']['auth'])) unset($menu['Order']);
			if(!in_array('orderModify',$_SESSION['user']['auth'])) unset($menu['Order'][0]['list']['import']);
			if(!in_array('orderStatistics',$_SESSION['user']['auth'])) unset($menu['Order'][1]);
			
			$data['menu'] = $menu;
			$data['user'] = $_SESSION['user'];
			
			return $this->renderFile ("index", $data);
		}	
		
	
}
?>